<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="vue.js"></script>
  <style>
    #box{
      width:200px;
      height:200px;
      background-color: rgb(191, 202, 35);
    }
    #box2{
      width:200px;
      height:200px;
      background-color: rgba(238, 93, 10, 0.863);
    }
  </style>
</head>
<body>
  <div id="app">
    <button @click="change">{{ isShow?'消失':'显示' }}</button>
    <div id="box" v-if="isShow">1</div>
    <div id="box2" v-else>2</div>
  </div>
  <script>
    let vm = new Vue({
      el:"#app",
      data:{
        isShow:false
      },
      methods:{
        change(){
          this.isShow = !this.isShow;
        }
      }
    })
  </script>
</body>
</html>